package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysADevelopersListMapper;
import com.ruoyi.system.domain.SysADevelopersList;
import com.ruoyi.system.service.ISysADevelopersListService;
import com.ruoyi.common.core.text.Convert;

/**
 * 开发商管理Service业务层处理
 * 
 * @author H
 * @date 2021-11-09
 */
@Service
public class SysADevelopersListServiceImpl implements ISysADevelopersListService 
{
    @Autowired
    private SysADevelopersListMapper sysADevelopersListMapper;

    /**
     * 查询开发商管理
     * 
     * @param developersId 开发商管理主键
     * @return 开发商管理
     */
    @Override
    public SysADevelopersList selectSysADevelopersListByDevelopersId(String developersId)
    {
        return sysADevelopersListMapper.selectSysADevelopersListByDevelopersId(developersId);
    }

    /**
     * 查询开发商管理列表
     * 
     * @param sysADevelopersList 开发商管理
     * @return 开发商管理
     */
    @Override
    public List<SysADevelopersList> selectSysADevelopersListList(SysADevelopersList sysADevelopersList)
    {
        return sysADevelopersListMapper.selectSysADevelopersListList(sysADevelopersList);
    }

    /**
     * 新增开发商管理
     * 
     * @param sysADevelopersList 开发商管理
     * @return 结果
     */
    @Override
    public int insertSysADevelopersList(SysADevelopersList sysADevelopersList)
    {
        if(sysADevelopersList.getDevelopersId()==null||"".equals(sysADevelopersList.getDevelopersId())){
            String uuid = UUID.randomUUID().toString();
            String id="DID"+DateUtils.dateTime()+uuid.substring(uuid.length()-5,uuid.length()-1);
            sysADevelopersList.setDevelopersId(id);
        }
        return sysADevelopersListMapper.insertSysADevelopersList(sysADevelopersList);
    }

    /**
     * 修改开发商管理
     * 
     * @param sysADevelopersList 开发商管理
     * @return 结果
     */
    @Override
    public int updateSysADevelopersList(SysADevelopersList sysADevelopersList)
    {
        return sysADevelopersListMapper.updateSysADevelopersList(sysADevelopersList);
    }

    /**
     * 批量删除开发商管理
     * 
     * @param developersIds 需要删除的开发商管理主键
     * @return 结果
     */
    @Override
    public int deleteSysADevelopersListByDevelopersIds(String developersIds)
    {
        return sysADevelopersListMapper.deleteSysADevelopersListByDevelopersIds(Convert.toStrArray(developersIds));
    }

    /**
     * 删除开发商管理信息
     * 
     * @param developersId 开发商管理主键
     * @return 结果
     */
    @Override
    public int deleteSysADevelopersListByDevelopersId(String developersId)
    {
        return sysADevelopersListMapper.deleteSysADevelopersListByDevelopersId(developersId);
    }
}
